package cn.liyao.web.model;



import lombok.Data;
import org.springframework.data.annotation.CreatedDate;

import javax.persistence.*;
import java.util.Date;

@Entity
@Data
@Table(name = "t_groups_member")
public class GroupMember {

    @Id
    @Column(unique = true,columnDefinition = "VARCHAR(64)")
    private String id;

    @Column(columnDefinition = "VARCHAR(64)")
    private String groupId;

    @Column(columnDefinition = "VARCHAR(64)")
    private String userId;


    private String remark;

    @CreatedDate
    @Temporal(TemporalType.TIMESTAMP)
    @Column(updatable = false)
    private Date joinTime;


    // state 0 在群 1 已移除
    private Integer userState = 0;

    @Temporal(TemporalType.TIMESTAMP)
    @Column(updatable = false)
    private Date leaveTime;


}